package com.sky.controller.user;

import com.sky.dto.UserLoginDTO;
import com.sky.entity.User;
import com.sky.result.Result;
import com.sky.service.UserService;
import com.sky.vo.UserLoginVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author with葡萄成熟时
 * @version 1.0
 */
@RestController
@Api(tags = "用户登录相关接口")
@Slf4j
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/user/user/login")
    @ApiOperation("登录相关接口")
    public Result<UserLoginVO> login(@RequestBody UserLoginDTO userLoginDTO) {

      UserLoginVO userLoginVO=  userService.login(userLoginDTO);

        return Result.success(userLoginVO);

    }


}
